package com.stu.mall.cart.service;

import com.stu.mall.cart.vo.CartItemVo;
import com.stu.mall.cart.vo.CartVo;

import java.util.List;
import java.util.concurrent.ExecutionException;

/**
 * @author linhs
 * @Title:
 * @Package
 * @Description:
 * @date 2022/3/28 16:57
 */
public interface CartService {

    CartItemVo addToCart(Long skuId, Integer num) throws ExecutionException, InterruptedException;

    CartItemVo getCartItem(Long skuId);

    CartVo getCart() throws ExecutionException, InterruptedException;

    void clearCartInfo(String cartKey);


    /**
     * 勾选购物项
     * @param skuId
     * @param check
     */
    void checkItem(Long skuId, Integer check);

    /**
     * 改变商品数量
     * @param skuId
     * @param num
     */
    void changeItemCount(Long skuId, Integer num);


    /**
     * 删除购物项
     * @param skuId
     */
    void deleteIdCartInfo(Integer skuId);

    /**
     * 获取当前用户的购物车所有商品项
     * @return
     */
    List<CartItemVo> getUserCartItems();
}
